using System;
using System.ServiceModel;
using Mindscape.BackgroundMotion.Services.Contracts;
using Mindscape.BackgroundMotion.Services.Contracts.Entities;

namespace SimpleServiceConsumer
{
  class Program
  {
    static void Main(string[] args)
    {
      try
      {
        using (ChannelFactory<IContentService> factory = new ChannelFactory<IContentService>("ContentEndpoint"))
        {
          IContentService service = factory.CreateChannel();

          Console.WriteLine("Fetching Contributions");
          Content contribution = service.GetContent(1);
          Console.WriteLine("{0}: {1}", contribution.Id, contribution.Description);
        }

        Console.WriteLine("Done..");
      }
      catch (Exception ex)
      {
        Console.WriteLine( "Exception: {0}", ex.ToString());
      }

      Console.ReadLine();
    }
  }
}
